/*
 * Copyright (C) 2010, Funcom AS, All Rights Reserved
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  @authors
 *  Svein Gunnar Larsen <sveingunnarlarsen@gmail.com>
 *  Erik Thune Lund <culex.eriklund@gmail.com>
 *  Michel Krohn-Dale <kronicz@gmail.com>
 */

package com.funcom.peeler.symbol;

import java.util.HashMap;
import java.util.Map;

public class Symbol {

    /* Node tag names */
    public class Node {

        public static final String
                button = "button",
                canvas_window = "canvas_window",
                check_box = "check_box",
                combo_box = "combo_box",
                component = "component",
                container = "container",
                geom_view = "geom_view",
                label = "label",
                layout = "layout",
                placeholder = "placeholder",
                rectangle = "rectangle",
                text_area ="text_area",
                text_field = "text_field",
                text_string = "text",
                toggle_button = "toggle_button",
                root = "peeler",
                properties = "properties",
                window = "window",
                workspace = "workspace";
    }

    /* Attribute names */
    public class Attr {

        public static final String
                base_path = "base_path",
                name = "name",
                height = "height",
                hide ="hide",
                last_path = "last_path",
                locale_text = "locale_text",
                localizer_path = "localizer_path",
                lock = "lock",
                pos_x = "pos_x",
                pos_y = "pos_y",
                style = "style",
                stylesheet = "stylesheet",
                text_string = "text_string",
                type = "type",
                width = "width";

        public class Layout {

            public static final String
                    absolute = "absolute",
                    border ="border",
                    group_hstretch = "group_hstretch",
                    group_vstretch ="group_vstretch",
                    none = "none",
                    table = "table";
        }
    }

    public enum BType {
        BUTTON,
        CANVASWINDOW,
        CHECKBOX,
        COMBOBOX,
        COMPONENT,
        CONTAINER,
        GEOMVIEW,
        LABEL,
        PLACEHOLDER,
        TEXTAREA,
        TEXTFIELD,
        TOGGLEBUTTON,
        SCROLLPANE,
        SLIDER,
        WINDOW,
        WORKSPACE
    }

    public static String[] psudoClasses = {  null,
                                            "hover",
                                            "disable",
                                            "down",
                                            "selected",
                                            "disselected" };

    public class StyleProperty {

        public static final String
                background = "background",
                border = "border",
                border_bottom = "border-down",
                border_left = "border-left",
                border_right = "border-right",
                border_top = "border-top",
                color = "color",
                cursor = "cursor",
                effect_color = "effect-color",
                effect_size = "effect-size",
                font = "font",
                icon = "icon",
                line_spacing = "line-spacing",
                padding = "padding",
                parent = "parent",
                text_align = "text-align",
                text_effect = "text-effect",
                size = "size",
                tooltip = "tooltip",
                vertical_align = "vertical-align";

    }

    public enum FontStyle {

        italic( "italic"),
        bold( "bold" ),
        bold_italic( "bolditalic" ),
        plain( "plain" );

        private FontStyle( String style ) {
            value = style;
        }

        public final String value;

    }

    public class Setting {

        public static final String
                grid_toggle = "grid_enabled",
                grid_size = "grid_size" ,
                export_canvas = "export_canvas";
    }

    public class Toggle {

        public static final String
                enabled = "enabled",
                disabled = "disabled";
    }

    public enum ToolType {
        SELECT,
        MULTI,
        MOVE,
        RESIZE,
        DELETE,
        PLACE,
        PAN,
        DOWN_HIERARCHY,
        UP_HIERARCHY,
        CHANGE,
        LOAD,
        LASSO,
        CUT,
        PASTE,
        GUIDE,
        GROUP,
        UNGROUP,
        COPY
    }

    public class ToolImage {
        public final static int SELECT = 0;
        public final static int MARK = 1;
        public final static int PAN = 2;
        public final static int RESIZE = 3;
        public final static int NEW = 4;
        public final static int SAVE = 5;
        public final static int LOAD = 6;        
    }

    public static final Map< String, BType > StringToType = new HashMap< String, BType >() {
        {
            put( Node.button, BType.BUTTON );
            put( Node.canvas_window, BType.CANVASWINDOW );
            put( Node.check_box, BType.CHECKBOX );
            put( Node.combo_box, BType.COMBOBOX );
            put( Node.component, BType.COMPONENT );
            put( Node.container, BType.CONTAINER );
            put( Node.geom_view, BType.GEOMVIEW );
            put( Node.label, BType.LABEL );
            put( Node.placeholder, BType.PLACEHOLDER );
            put( Node.text_area, BType.TEXTAREA );
            put( Node.text_field, BType.TEXTFIELD );
            put( Node.toggle_button, BType.TOGGLEBUTTON );
            put( Node.window, BType.WINDOW );
            put( Node.workspace, BType.WORKSPACE );
        }
    };
}
